package com.android.superobstacleavoider;

import android.app.Activity;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class Game extends Activity {
	public final static String KEY_DIFFICULTY = "com.android.superobstacleavoider.difficulty";
	public final static int DIFFICULTY_EASY = 0;
	public final static int DIFFICULTY_MEDIUM = 1;
	public final static int DIFFICULTY_HARD = 2;
	
	private static int m_difficulty = 0;	
	
	private GLView m_glView;
	
	public static int getDifficulty()
	{
		return m_difficulty;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		//kontrollera volymen med volym-knapparna
		this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
		
		//tar bort titeln
	    requestWindowFeature(Window.FEATURE_NO_TITLE);
	    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

		m_difficulty = getIntent().getIntExtra(KEY_DIFFICULTY, DIFFICULTY_EASY);
		
        m_glView = new GLView(this);         
        setContentView(m_glView);
	}

	@Override
	protected void onPause() {
		super.onPause();
		m_glView.onPause();
	}

	@Override
	protected void onResume() {
		super.onResume();
		m_glView.onResume();
	}	
}
